using System.Threading.Tasks;
using System.Collections.Generic;
using JGSY.CMS.LowCode.Platform.Application.DTOs;

namespace JGSY.CMS.LowCode.Platform.Application.Interfaces
{
    /// <summary>
    /// 安全管理应用服务接口。
    /// 提供安全指标监控、威胁检测、设备管理、地理位置登录监控和登录历史等安全相关业务功能接口定义。
    /// </summary>
    public interface ISecurityAppService
    {
        /// <summary>
        /// 获取安全指标统计数据
        /// </summary>
        /// <returns>安全指标数据传输对象</returns>
        Task<SecurityMetricsDto> GetMetricsAsync();
        
        /// <summary>
        /// 分页获取威胁信息
        /// </summary>
        /// <param name="severity">威胁严重程度</param>
        /// <param name="page">页码，默认为1</param>
        /// <param name="limit">每页数量，默认为10</param>
        /// <returns>威胁信息列表</returns>
        Task<IEnumerable<ThreatDto>> GetThreatsAsync(string severity, int page = 1, int limit = 10);
        
        /// <summary>
        /// 获取地理位置登录记录
        /// </summary>
        /// <param name="days">查询天数，默认为7天</param>
        /// <returns>地理位置登录记录列表</returns>
        Task<IEnumerable<GeographicLoginDto>> GetGeographicLoginsAsync(int days = 7);
        
        /// <summary>
        /// 获取设备列表
        /// </summary>
        /// <returns>设备信息列表</returns>
        Task<IEnumerable<DeviceDto>> GetDevicesAsync();
        
        /// <summary>
        /// 信任指定设备
        /// </summary>
        /// <param name="deviceId">设备标识符</param>
        /// <returns>信任操作任务</returns>
        Task TrustDeviceAsync(long deviceId);
        
        /// <summary>
        /// 移除指定设备
        /// </summary>
        /// <param name="deviceId">设备标识符</param>
        /// <returns>移除操作任务</returns>
        Task RemoveDeviceAsync(long deviceId);
        
        /// <summary>
        /// 分页获取登录历史记录
        /// </summary>
        /// <param name="page">页码，默认为1</param>
        /// <param name="limit">每页数量，默认为10</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="endDate">结束日期</param>
        /// <returns>登录历史记录列表</returns>
        Task<IEnumerable<LoginHistoryDto>> GetLoginHistoryAsync(int page = 1, int limit = 10, string? startDate = null, string? endDate = null);
    }
}
